-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/vnf skeleton #5
Conversation
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
...native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/c_converter_api.h
Outdated
Show resolved
Hide resolved
...tive_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native_c/src/c_converter_api.cpp
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native_c/src/handle.hpp
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp
Show resolved
Hide resolved
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i cannot review more than this cause it's a fundamental design issue
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
power_grid_model_io_native_c/power_grid_model_io_native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
..._grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp
Outdated
Show resolved
Hide resolved
..._grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp
Show resolved
Hide resolved
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
We haven't introduced any checks to skip from checking for clang tidy. Probably we can take the ones from PGM, most of clang tidy complaints should be fixed that way. |
I propose only disabling the checks that are disablef in pgm and that also complain on this repo. New code should be better bu default, and case-by-case disabled at worst |
Signed-off-by: Jerry Guo <[email protected]>
Signed-off-by: Jerry Guo <[email protected]>
Signed-off-by: Jerry Guo <[email protected]>
Signed-off-by: Jerry Guo <[email protected]>
Feature / reorganize dependency
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the skeleton will be pretty much ok when those minor issues are polished. Also pay attention to the east const, which we take as standard inside PGM.
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
I believe sonar cloud complaints are in a way false positive. Complaints for new and delete are also not accurate I think. It would prefer if we used memory management techniques which automatically manage the memory, but they free up the memory when going out of scope. So if the scope is a function where we created the pointer, after that function it would be destroyed. While in our example, we have 3 api functions which all need the same pointer. I can't add to much towards arguing for reinterpret_cast, but it is used when casting from one pointer to another, useful in opaque pointers. |
You are right. Feel free to disable those false positives if you are certain.
Same goes here. |
That is fair. It can be re-evaluated when the actual implementation is made.
This may be resolved once the actual implementation of the VNF converter class is implemented, as the memory management can be dealt with there in a safer way. For now, it should be okay.
There is nothing much we can really do here, that is how C APIs work. On the other hand, when we leave so many un-resolved smells on purpose, do we have a way to go about it at the moment? This can be easily forgotten, or at least the reasoning behind it. Maybe @Jerry-Jinfeng-Guo or @mgovers can comment on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
...tive_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h
Outdated
Show resolved
Hide resolved
...tive_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h
Outdated
Show resolved
Hide resolved
..._grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp
Outdated
Show resolved
Hide resolved
@figueroa1395 The priority now is push forward this project. Most of the sonar cloud issues are indeed false positive if we inspect them case by case. Being stuck at polishing at such an early stage is not only counterproductive but can also be frustrating for @Laurynas-Jagutis . Therefore, I would argue for pushing forward so long as the direction is correct. |
Signed-off-by: Laurynas Jagutis <[email protected]>
I agree. And it should not be a blocker specially at this stage. Maybe I phrased my words wrong. I was just raising it such that we can create an action point to make agreements (if not present yet) to know how to handle it in the future. But I think we can just ignore them for this PR. |
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
Signed-off-by: Laurynas Jagutis <[email protected]>
The changes have taken place, another person will approve this pull request
Signed-off-by: Laurynas Jagutis <[email protected]>
.gitmodules
Outdated
url = [email protected]:PowerGridModel/power-grid-model.git | ||
[submodule "deps/power-grid-model"] | ||
path = deps/power-grid-model | ||
url = https://github.com/PowerGridModel/power-grid-model.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought, please update this line to use the ssh protocal
url = https://github.com/PowerGridModel/power-grid-model.git | |
url = git@github.com:PowerGridModel/power-grid-model.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all our users may have SSH installed. In addition, it is and open-source, so security is also not an issue on that side.
The HTPPS protocol is actually probably desired... @Jerry-Jinfeng-Guo what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree on the esay to use side of https. We can change it back in the next PR. I was just under the impression that open source project tend to prefer ssh because it is cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
@@ -20,6 +20,7 @@ sonar.sourceEncoding=UTF-8 | |||
sonar.issue.ignore.allfile=a1 | |||
sonar.issue.ignore.allfile.a1.fileRegexp='.*#include.*doctest\.h[>"].*' | |||
sonar.coverage.exclusions="tests/**/*" | |||
sonar.coverage.exclusions=power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp,power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a todo here as well:
sonar.coverage.exclusions=power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp,power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp | |
# TODO(Laurynas-Jagutis) remove temporary scan disables | |
sonar.coverage.exclusions=power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp,power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp |
power_grid_model_io_native_c/power_grid_model_io_native_c/CMakeLists.txt
Outdated
Show resolved
Hide resolved
..._grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp
Show resolved
Hide resolved
Signed-off-by: Laurynas Jagutis <[email protected]>
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the comments have been addressed, so I approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good progress. really happy you were able to get this in a good state without needing my input!
find_package(Eigen3 CONFIG REQUIRED) | ||
find_package(Boost REQUIRED) | ||
find_package(nlohmann_json CONFIG REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not trying to revert this PR, but do you need to find these again? since the PGM core already hard-depends on this, you already have this from that location. Even more so, you're now actually overwriting the Eigen3_FOUND
, Boost_FOUND
and nlohmann_json_FOUND
variables (and everything related). I think this is both redundant and actually more error-prone.
void convert_links_input(); | ||
}; | ||
|
||
inline PgmVnfConverter::PgmVnfConverter(char* buffer, power_grid_model::WritableDataset* data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a particular reason why you went with out-of-line implementations instead of in-class implementations (as we do in the PGM):
class PgmVnfConverter {
public:
PgmVnfConverter(char* buffer = nullptr, power_grid_model::WritableDataset* data = nullptr)
: f_file_buffer(buffer), deserialized_data(data) {
using namespace std::string_literals;
using power_grid_model::ExperimentalFeature;
throw ExperimentalFeature{"PGM_VNF_converter", ExperimentalFeature::TypeValuePair{.name = "PGM_VNF_conversion",
.value = std::to_string(1)}};
}
// the rest of the functions
// ...
};
yeah.... this has been on my mind as well... Personally, I think we should use either This is a team decision, though. |
* @brief Destroy the converter and free up the memory that was dedicated to it. | ||
* @param converter_ptr A pointer to a PGM_VNF_converter instance. | ||
*/ | ||
PGM_IO_API void PGM_VNF_delete_Converter(PGM_IO_VnfConverter* converter_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
PGM_IO_API void PGM_VNF_delete_Converter(PGM_IO_VnfConverter* converter_ptr); | |
PGM_IO_API void PGM_VNF_delete_converter(PGM_IO_VnfConverter* converter_ptr); |
Maybe we can bring this up as an action point to discuss in a knowledge sharing session. Definitely we should try to contain |
No description provided.